<style>
    body{
        background:#f2f2f2!important;
    }
    .xian {
        width: 8px;
        height: 20px;
        background: #486bd3;
        margin-right: 10px;
        margin-left: 10px;
    }

    .tab-top-label{
        box-sizing: border-box;
        /*background: #e3eced;*/
        display: flex;
        align-items: center;
        font-size: 14px;
        color: #666;
        line-height: 30px;
        margin-bottom: 10px;
    }
    .tab-label{
        width: 100px;
        text-align: center;
        cursor: pointer;
        height: 30px;
        line-height: 30px;
        border-radius: 4px;
        margin-left: 80px;
        margin-bottom: 0;
    }
    .tab-label:nth-child(1){
        margin-left: 0;
    }
    .tab-labels{
        box-sizing: border-box;
        background: #edf0f9;
        display: flex;
        align-items: center;
        font-size: 16px;
        color: #333;
        line-height: 30px;
        margin-bottom: 10px;
    }
    .tabs-content{
        display: flex;
        flex-direction: column-reverse;
        padding-top: 20px;
        width: 98%;
        margin: auto;
    }

    .tabs-content > .tab {
        display: none;
    }
    .tabs-content > div.active {
        display: block;
    }
    .hang .col-sm-2 {
        width: 100%;
        text-align: left;
    }
    .hang{
        width: 100%;
        display: flex;
    }
    .hang .form-group{
        width: 25%;
        float: left;
    }
    #tab1 input{
        background-color: #fff!important;
    }
    #tab2 input{
        background-color: #fff!important;
    }
    #tab2 select{
        background-color: #fff!important;
    }
    #tab1 textarea{
        background-color: #fff!important;
    }
    .tabs-content .tab .left{
        width: 25%;
        float: left;
    }
    .tabs-content .tab .right{
        width: 25%;
        float: left;
    }
    .tabs-content .tab .zhong{
        width: 25%;
        float: left;
    }

    .tabs .col-sm-2{
        width: 100%;
        text-align: left;
    }
    .tcxm-td td{
        background: #4e73df;
        color: #fff;
        text-align: center;
        border-right: 1px solid;
    }
    .form-inline input{
        width: 100%!important;
    }
    .form-inline td:nth-child(1) input{
        width: 12%!important;
    }
    .form-inline td{
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .form-inline td:nth-child(1){
        border-left: 1px solid #e6e6e6;
    }
    .form-inline td:nth-child(1){
        text-align: center;
    }
    .xia{
        width: 100%;
        display: flow-root;
    }

    .tab-label.active{
        background: #4e73df;
        color: #fff;
    }
    .gai_task_num{
        border-radius: 0!important;
        color: #858585;
        background-color: #FFF;
        border: 1px solid #D5D5D5;
        font-size: 14px;
        font-family: inherit;
        -webkit-box-shadow: none!important;
        box-shadow: none!important;
        -webkit-transition-duration: .1s;
        transition-duration: .1s;
    }

    .shenhe{
        background-color: #fff;
        margin-top: 20px;
        height: 100%;
        margin-bottom: 100px;
    }
    .shenhe-content{
        display: flex;
        flex-direction: column-reverse;
        /*padding-top: 20px;*/
        width: 100%;
        margin: auto;
    }
    .shenhe-content .fieldlist{
        width: 98%;
        margin: auto;
    }
    .shenhe-td td{
        /*background: #3683D3;*/
        background: #4e73df;
        color: #fff;
        text-align: left;
        border-right: 1px solid #e6e6e6;
    }
    .shenhe-td td:nth-child(1){
        width: 200px;
        border-left: 1px solid #e6e6e6;
    }
    .shenhe-td td:nth-child(2){
        width: 150px;
    }
    .shenhe-inline td{
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .shenhe-inline td:nth-child(1){
        border-left: 1px solid #e6e6e6;
    }
    .shenhe-inline td:nth-child(1){
        text-align: left;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" id="bids" value="{$row.id}">
    <div class="tabs">
        <div class="tab-top-label">
<!--            <div class="xian"></div>-->
            <label class="tab-label active" for="tab1">报案信息</label>
            <label class="tab-label" for="tab2" id="tab22">车辆服务情况</label>
            <label class="tab-label" for="tab3" id="tab44">调度中心</label>
        </div>

        <div class="tabs-content">
            <div id="tab1" class="tab active">
                <div class="tab-labels">
                    <div class="xian"></div>
                    接报案录入
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('报案单号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-baoan_id" class="form-control"  type="text" value="{$row.baoan_id}" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('服务单号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-tong_number" class="form-control"  type="text" value="{$row.tong_number}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('车牌号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-car_num" class="form-control"  type="text" value="{$row.car_num}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('车架号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-car_vin" class="form-control"  type="text" value="{$row.car_vin}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('被服务人')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-learned_name" class="form-control"  type="text" value="{$row.learned_name}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('被服务人手机')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-learned_phone" class="form-control"  type="text" value="{$row.learned_phone}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('核统日期')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-yw_hetong_time" class="form-control"  type="text" value="{:date('Y-m-d', $row['yw_hetong_time'])}">
                            <!--                            <input id="c-yw_hetong_time" class="form-control" name="row[yw_hetong_time]" type="text" value="{$row.yw_hetong_time}">-->
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('归属部门')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-yw_class" class="form-control" type="text" value="{$row.yw_class_text}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('归属人')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-yw_belonger" class="form-control"  type="text" value="{$row.yw_belonger}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('服务起期')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-plan_strattime" class="form-control"  type="text" value="{:date('Y-m-d', $row['plan_strattime'])}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('服务止期')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-plan_endtime" class="form-control" " type="text" value="{:date('Y-m-d', $row['plan_endtime'])}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('报案人')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-baoan_ren" class="form-control"  type="text" value="{$row.baoan_ren}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('报案人电话')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-baoan_phone" class="form-control"  type="text" value="{$row.baoan_phone}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('报案时间')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-baoan_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"  type="text" value="{$row['baoan_time'] ? date('Y-m-d H:i:s', $row['baoan_time']) : ''}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('出险时间')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-chuxian_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"  type="text" value="{$row['chuxian_time'] ? date('Y-m-d H:i:s', $row['chuxian_time']) : ''}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('事故情况')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input type="text" class="form-control" value="{$row.shigu_condition}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('是否有人伤')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input type="text" class="form-control" value="{$row['is_renshang'] == 0 ? '否' : '是'}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('交强投保公司')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-car_tbgs" class="form-control" type="text" value="{$row.car_tbgs}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('驾驶员')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-car_ren" class="form-control"  type="text" value="{$row.car_ren}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('驾驶员电话')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-phone" class="form-control"  type="text" value="{$row.phone}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('道路类型')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input type="text" class="form-control" value="{$row.daolu_type}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('是否现场报案')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input type="text" class="form-control" value="{$row.is_xcba == 0 ? '否' : '是'}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('是否联系交警')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input type="text" class="form-control" value="{$row.is_lxjj == 0 ? '否' : '是'}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('出险地点')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="c-address" class="form-control"  type="text" value="{$row.address}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('查勘人')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input class="form-control"  type="text" value="{$row.chakan_ren}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input class="form-control" type="text" value="{$row.mobile}">
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group" style="width: 100%">
                        <label class="control-label col-xs-12 col-sm-2">{:__('出险描述')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <textarea id="c-chuxian_describe" class="form-control"  type="text" rows="5" value="" readonly>{$row.chuxian_describe}</textarea>
                        </div>
                    </div>
                </div>
                <div class="hang">
                    <div class="form-group" style="width: 100%!important;">
                        <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <textarea class="form-control"  type="text" rows="5" value="" readonly>{$row.beizhu}</textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab2" class="tab">
                <div class="top">
                    <div class="tab-labels">
                        <div class="xian"></div>
                        车辆信息
                    </div>
                    <div class="left">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Plan_strattime')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-plan_strattime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"  type="text" value="{:date('Y-m-d H:i:s', $res['plan_strattime'])}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Yw_come')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-yw_come" class="form-control"  type="text" value="{$res.yw_come}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_num')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_num" class="form-control"  type="text" value="{$res.car_num}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_register')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_register" class="form-control"  type="text" value="{$res.car_register}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_use_nature')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <select  id="c-car_use_nature" class="form-control">
                                    <?php foreach($xingzhi as $k => $v){?>
                                    <option value="{$v}" <?php if($res['car_use_nature']== $v){?> selected<?php }?>>{$k}</option>
                                    <?php }?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_carry_peo')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_carry_peo" class="form-control"  type="number" value="{$res.car_carry_peo}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_curb_weight')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_curb_weight" class="form-control"  type="text" value="{$res.car_curb_weight}">
                            </div>
                        </div>

                    </div>
                    <div class="zhong">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Plan_endtime')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-plan_endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"  type="text" value="{:date('Y-m-d H:i:s', $res['plan_endtime'])}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Yw_class')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-yw_class" class="form-control"  type="text" value="{$res.yw_class_text}">
                                <input id="yw_class" class="form-control"  type="hidden" value="{$res.yw_class}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_vin')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_vin" class="form-control"  type="text" value="{$res.car_vin}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Chexing')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <select  id="c-chexing"  class="form-control">
                                    <?php foreach($chexing as $k => $v){?>
                                    <option value="{$v}" <?php if($res['chexing']== $v){?> selected<?php }?>>{$k}</option>
                                    <?php }?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_carry_quality')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_carry_quality" class="form-control"  type="text" value="{$res.car_carry_quality}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_reall')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_reall" class="form-control"  type="text" value="{$res.car_reall}">
                            </div>
                        </div>
                    </div>
                    <div class="right">
                        <div class="form-group" style="height: 62px;padding-top: 25px;">
                            <label class="control-label col-xs-12" style="width: 20%;text-align: left;padding-right: 0;">服务天数:</label>
                            <div class="col-xs-12 col-sm-8" style="margin-top: 7px;padding-left: 0;" id="datecount">
                                365天
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Yw_belonger')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-yw_belonger" class="form-control"  type="text" value="{$res.yw_belonger}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_engine')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_engine" class="form-control"  type="text" value="{$res.car_engine}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Chexing_ci')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-ncd" class="form-control"  type="text" value="{$res.ncd}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_buy')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_buy" class="form-control"  type="text" value="{$res.car_buy}">
                            </div>
                        </div>
                    </div>
                    <div class="right">
                        <div class="form-group" style="height: 62px;">
                            <label class="control-label col-xs-12" style="width: 20%;text-align: left;padding-right: 0;"></label>
                            <div class="col-xs-12 col-sm-10" style="margin-top: 7px;padding-left: 0;">

                            </div>
                        </div>
                        <div class="form-group" style="height: 62px;">
                            <label class="control-label col-xs-12" style="width: 20%;text-align: left;padding-right: 0;"></label>
                            <div class="col-xs-12 col-sm-10" style="margin-top: 7px;padding-left: 0;">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Car_factory_num')}<span style="color:red">*</span>:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_factory_num" class="form-control"  type="text" value="{$res.car_factory_num}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="xia">
                    <div class="tab-labels">
                        <div class="xian"></div>
                        服务项目
                    </div>
                    <div class="form-group">
                        <div class="col-xs-12">
                            <table class="table fieldlist" data-template="basictpl" data-name="res[basic]" id="first-table">
                                <tr class="tcxm-td">
                                    <!--                                <td><input type="checkbox" name="" id="checks"></td>-->
                                    <td>{:__('主服务项目')}</td>
                                    <td>{:__('服务金额')}</td>
                                    <!--                                <td>{:__('不计免赔')}</td>-->
                                    <td>{:__('标准服务费')}</td>
                                    <td>{:__('折扣(%)')}</td>
                                    <td>{:__('应缴服务费')}</td>
                                </tr>
                                <!--                            机动车损失服务-->
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[main_name]" id="main_name" value="1" class="chk" <?= $res['main_name'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>机动车损失服务</td>
                                    <td><input type="text"  id="main_money" class="form-control" size="15" value="{$res.main_money}" placeholder="" readonly/></td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" value="{$res.main_franchise}" name="res[main_franchise]" id="main_franchise">-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="main_standard" class="form-control zongshu" value="{$res.main_standard}" readonly/></td>
                                    <td><input type="text"  id="sun" class="form-control"  value="{$res.main_discount}" readonly /></td>
                                    <td><input type="text"  id="main_submit" class="form-control zong_tongchou" value="{$res.main_submit}" readonly/></td>
                                </tr>
                                <!--                            机动车损失服务-->
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[main_disan]" id="main_disan" value="1" class="chk" <?= $res['main_disan'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>机动车第三者责任服务</td>
                                    <td>
                                        <select  id="main_santong" class="form-control" style="width: 100%">
                                            <option value="">请选择</option>
                                            <option value="3000000" <?php if($res['main_santong']=="3000000"){?> selected<?php }?>>300万</option>
                                            <option value="2000000" <?php if($res['main_santong']=="2000000"){?> selected<?php }?>>200万</option>
                                            <option value="1500000" <?php if($res['main_santong']=="1500000"){?> selected<?php }?>>150万</option>
                                            <option value="1000000" <?php if($res['main_santong']=="1000000"){?> selected<?php }?>>100万</option>
                                            <option value="500000" <?php if($res['main_santong']=="500000"){?> selected<?php }?>>50万</option>
                                        </select>
                                    </td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" value="{$res.main_ji}" name="res[main_ji]" id="main_ji" />-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="main_biao" class="form-control zongshu" value="{$res.main_biao}"/></td>
                                    <td><input type="text"  id="san" class="form-control"  value="{$res.main_zhe}" readonly/></td>
                                    <td><input type="text"  id="main_yingjiao" class="form-control zong_tongchou" value="{$res.main_yingjiao}" readonly/></td>
                                </tr>
                                <!--                            机动车损失服务-->
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[siji]" id="si_jis" value="1" class="chk" <?= $res['siji'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>车上人员责任服务(司机)<input type="text" class="form-control" value="1" style="text-align: center" disabled/></td>
                                    <td>
                                        <select  id="siji_tong" style="width: 100%" class="form-control">
                                            <option value="">请选择</option>
                                            <option value="10000" <?php if($res['siji_tong']=="10000"){?> selected<?php }?>>1万</option>
                                            <option value="20000" <?php if($res['siji_tong']=="20000"){?> selected<?php }?>>2万</option>
                                            <option value="30000" <?php if($res['siji_tong']=="30000"){?> selected<?php }?>>3万</option>
                                            <option value="40000" <?php if($res['siji_tong']=="40000"){?> selected<?php }?>>4万</option>
                                            <option value="50000" <?php if($res['siji_tong']=="50000"){?> selected<?php }?>>5万</option>
                                            <option value="100000" <?php if($res['siji_tong']=="100000"){?> selected<?php }?>>10万</option>
                                            <option value="200000" <?php if($res['siji_tong']=="200000"){?> selected<?php }?>>20万</option>
                                        </select>
                                    </td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" value="{$res.siji_ji}" name="res[siji_ji]" id="siji_ji" />-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="siji_biao" class="form-control zongshu" value="{$res.siji_biao}"/></td>
                                    <td><input type="text"  id="siji" class="form-control"  value="{$res.siji_zhe}" readonly/></td>
                                    <td><input type="text"  id="siji_ying" class="form-control zong_tongchou" value="{$res.siji_ying}" readonly/></td>
                                </tr>
                                <!--                            机动车损失服务-->
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[chengke]" id="chengkess" value="1" class="chk" <?= $res['chengke'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>车上人员责任服务(乘客)<input type="text"  id="zuo" class="form-control" size="15" value="{$res.chengke_zuo}" style="text-align: center" readonly/>座</td>
                                    <td>
                                        <input type="hidden"  id="ck_tong" value="{$res.ck_tong}" readonly="readonly"
                                               style="width: 100%;height: 100%;border: none;margin: 0;">
                                        <select  id="ck" style="width:100%;" class="form-control">
                                            <option value="">请选择</option>
                                            <option value="10000" <?php if($res['ck_money']=="10000"){?> selected<?php }?>>1万</option>
                                            <option value="20000" <?php if($res['ck_money']=="20000"){?> selected<?php }?>>2万</option>
                                            <option value="30000" <?php if($res['ck_money']=="30000"){?> selected<?php }?>>3万</option>
                                            <option value="40000" <?php if($res['ck_money']=="40000"){?> selected<?php }?>>4万</option>
                                            <option value="50000" <?php if($res['ck_money']=="50000"){?> selected<?php }?>>5万</option>
                                            <option value="100000" <?php if($res['ck_money']=="100000"){?> selected<?php }?>>10万</option>
                                            <option value="200000" <?php if($res['ck_money']=="200000"){?> selected<?php }?>>20万</option>
                                        </select>
                                    </td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[ck_ji]" id="ck_ji" value="{$res.ck_ji}" />-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="ck_biao" class="form-control zongshu" value="{$res.ck_biao}"/></td>
                                    <td><input type="text"  id="cheng" class="form-control"  value="{$res.ck_zhe}" readonly/></td>
                                    <td><input type="text"  id="ck_ying" class="form-control zong_tongchou" value="{$res.ck_ying}" readonly/></td>
                                </tr>
                                <tr class="tcxm-td">
                                    <!--                                <td>	<input type="checkbox" lay-filter="checkall" name="" id="checkss"></td>-->
                                    <td>{:__('附加服务项目')}</td>
                                    <td>{:__('服务金额')}</td>
                                    <!--                                <td>{:__('不计免赔')}</td>-->
                                    <td>{:__('标准服务费')}</td>
                                    <td>{:__('折扣(%)')}</td>
                                    <td>{:__('应缴服务费')}</td>
                                </tr>
                                <!--                            机动车损失服务-->
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[dao_name]" id="dao_name" value="1" class="chks" <?= $res['dao_name'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>三者医保外用药</td>
                                    <td>
                                        <select  id="dao_tong" class="form-control" style="width: 100%" >
                                            <option value="">请选择</option>
                                            <option value="50000" <?php if($res['dao_tong']=="50000"){?> selected<?php }?>>5万</option>
                                            <option value="100000" <?php if($res['dao_tong']=="100000"){?> selected<?php }?>>10万</option>
                                        </select>
                                    </td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" value="{$res.dao_ji}" name="res[dao_ji]" id="dao_ji" />-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="dao_biao" class="form-control zongshu" value="{$res.dao_biao}"  readonly/></td>
                                    <td><input type="text"  id="dao" class="form-control"  value="100" readonly/></td>
                                    <td><input type="text"  id="dao_ying" class="form-control zong_tongchou" value="{$res.dao_ying}" readonly/></td>
                                </tr>
                                <tr class="form-inline">
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[dianwang]" value="1" id="dianwangs" class="chks" <?= $res['dianwang'] ==1? ' checked="checked"' : '';?>>-->
                                    <!--                                </td>-->
                                    <td>附加外部电网故障损失险</td>
                                    <td><input type="text" n id="dw_tong" class="form-control" size="15" value="{$res.dw_tong}" placeholder=""  readonly/></td>
                                    <!--                                <td style="text-align: center">-->
                                    <!--                                    <input type="checkbox" name="res[dw_ji]" id="dw_ji" value="{$res.dw_ji}" />-->
                                    <!--                                </td>-->
                                    <td><input type="text"  id="dw_biao" class="form-control zongshu" value="{$res.dw_biao}"  readonly/></td>
                                    <td><input type="text"  id="dw" class="form-control"  value="100" readonly/></td>
                                    <td><input type="text"  id="dw_ying" class="form-control zong_tongchou" value="{$res.dw_ying}" readonly/></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="form-group" style="margin-left: 0;">
                        <div class="right">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('标准服务费（合计）')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input type="text" class="form-control"  placeholder="请输入标准服务费（合计）"  id="main_sum" oninput="vs()" onpropertychange="vs()" value="{$res.main_sum}" readonly="readonly">
                                </div>
                            </div>
                        </div>

                        <div class="right">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('折扣')}<span style="color:red">*</span>:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input type="text"  class="form-control" id="addz" value="{$res.main_sumdiscount}" data-rule="required"/>
                                </div>
                            </div>
                        </div>

                        <div class="right">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('服务费（合计）')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input type="text" class="form-control"  placeholder="请输入服务费（合计）"  id="main_free" oninput="vs()" onpropertychange="vs()" value="{$res.main_free}" readonly="readonly">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="tab-labels">
                        <div class="xian"></div>
                        特约及争议解决方式
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2" style="width: 110px;">{:__('争议解决方')}:</label>
                        <div class="col-xs-12 col-sm-8" style="top: 7px;left: 0">
                            <input type="radio" name="row[resolvent]" disabled value="{$res.resolvent}"  <?= $res['resolvent'] == 1 ? ' checked="checked"' : '';?> /> 诉讼
                            <input type="radio" name="row[resolvent]" disabled value="{$res.resolvent}"  <?= $res['resolvent'] == 2 ? ' checked="checked"' : '';?>/>仲裁
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('特别约定')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <textarea name="row[special]" rows="5" cols="10" id="txt" value="" readonly="" class="form-control" style="background: #fff;">{$res.special}</textarea>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="tab-labels">
                        <div class="xian"></div>
                        车主信息
                    </div>
                    <div class="hang">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('姓名')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_owner" class="form-control"  type="text" value="{$res.car_owner}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('证件类型')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <select  id="car_card_kind" disabled="disabled" class="form-control">
                                    <option value="0" <?php if($res['car_card_kind']=="0"){?> selected<?php }?>>身份证</option>
                                    <option value="1" <?php if($res['car_card_kind']=="1"){?> selected<?php }?>>统一社会信用代码</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('证件号码')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-car_card" class="form-control"  type="text" value="{$res.car_card}">
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="tab-labels">
                        <div class="xian"></div>
                        被服务人信息
                    </div>
                    <div class="hang">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('姓名')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-learned_name" class="form-control"  type="text" value="{$res.learned_name}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('证件类型')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <select  id="learned_kind" disabled="disabled" class="form-control">
                                    <option value="0" <?php if($res['learned_kind']=="0"){?> selected<?php }?>>身份证</option>
                                    <option value="1" <?php if($res['learned_kind']=="1"){?> selected<?php }?>>统一社会信用代码</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('证件号码')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-learned_num" class="form-control"  type="text" value="{$res.learned_num}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('手机')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="c-learned_phone" class="form-control"  type="text" value="{$res.learned_phone}">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab3" class="tab">
                <div>
                    <div class="tab-labels">
                        <div class="xian"></div>
                        委派查勘
                    </div>
                    <div class="hang">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('查勘机构')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <select  id="chakan_group" name="row[chakan_group]" class="form-control" data-select="{$row['chakan_group']}">
                                    <option value="">请选择查勘人</option>
                                    <?php foreach($zuzhi as $k => $v){?>
                                    <option value="{$v.id}" {if $row['chakan_group'] == $v['id']}selected{/if}>{$v.name}</option>
                                    <?php }?>
                                </select>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('查勘人')}:</label>
                            <div class="col-xs-12 col-sm-10">
<!--                                <select  id="chakan_user_id" name="row[chakan_user_id]" class="form-control" data-select="{$row['chakan_user_id']}" data-live-search=“true”>-->
<!--                                    <option value="">请选择查勘人</option>-->
<!--                                </select>-->
                                <input type="text" id="chakan_ren_name" class="form-control" value="{$row.chakan_ren}" name="row[chakan_ren]" list="chakan_user_list" placeholder="请选择查勘人"/>
                                <datalist id='chakan_user_list'>

                                </datalist>
                                <input type="hidden" id="chakan_user_id" value="{$row.chakan_user_id}" name="row[chakan_user_id]">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
                            <div class="col-xs-12 col-sm-10">
                                <input id="mobile" class="form-control" name="row[mobile]" type="text" value="{$row.mobile}">
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="tab-labels">
                        <div class="xian"></div>
                        委派任务
                    </div>
                    <div class="hang">
                        {volist name="task" id="vo"}
                        <input id="gai_task_{$key}" type="checkbox" name="gai_task[]" value="{$key}" style="margin-left: 2%" readonly>{$vo}
                        <input id="gai_task_num_{$key}" type="number" name="gai_task_num[]" value="1" style="width: 70px;" <?= $key ==1? ' readonly="readonly"' : '';?>  class="gai_task_num form-control">
                        {/volist}
                    </div>
                    <hr/>
                    <div class="hang">
                        <input type="radio" name="duanxin" class="send_type" value="1" id="kehu_duan" checked="checked" style="margin-left: 2%">发送客户
                        <input type="radio" name="duanxin" class="send_type" value="2" id="chakan_duan" style="margin-left: 2%">发送查勘人
                    </div>
                    <div class="hang">
                        <div class="form-group" style="width: 50%;">
                            <label class="control-label col-xs-12"></label>
                            <div class="col-xs-12 " style="margin-left: 20px;">
                                <textarea id="sms_moban" style="width: 500px;height: 150px;margin: 1%;background-color: #fff" disabled=""></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="hang">
                        <div class="form-group " style="width: 100%;">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 " style="text-align: center;margin: auto;">
                                <button  class="tab-label1 btn btn-primary btn-embossed" style="width:100px;background:#1b4fe7" type="button" onclick="send_tpl(this)">生成短信</button>
                                <button  class="tab-label1 btn btn-primary btn-embossed" style="width:100px;margin-left: 20px;background:#1b4fe7" type="button"onclick="do_send_sms(this)" >发送短信</button>
                            </div>
                        </div>
                    </div>
                    <div class="hang">
                        <div class="form-group" style="width: 100%;">
                            <label class="control-label col-xs-12 col-sm-2">备注</label>
                            <div class="col-xs-12 " style="margin-left: 20px;">
                                <textarea id="beizhu" class="form-control" rows="8" name="row[beizhu]">{$row.beizhu}</textarea>
                            </div>
                        </div>
                    </div>
                    <div class="hang">
                        <div class="form-group " style="width: 100%;">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 " style="text-align: center;margin: auto;">
                                <button  class="tab-label1 btn btn-primary btn-embossed" style="width:100px;background:#1b4fe7" type="submit">提交</button>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="shenhe">
                    <div class="tab-labels">
                        <div class="xian"></div>
                        委派日志
                    </div>
                    <div class="shenhe-content">
                        <table class="table fieldlist" data-template="basictpl" data-name="row[basic]" id="">
                            <tr class="shenhe-td">
                                <td>{:__('时间')}</td>
                                <td>{:__('操作人')}</td>
                                <td>{:__('委派详情')}</td>
                            </tr>
                            {volist name='diaodu_log' id='vo'}
                            <tr class="shenhe-inline">
                                <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                                <td>{$vo.user_name}</td>
                                <td>{$vo.remark}</td>
                            </tr>
                            {/volist}
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

</form>
<script src="/assets/js/ace1.4/assets/js/jquery.min.js" type="text/javascript"></script>
<script src="/assets/js/sms.js" type="text/javascript"></script>
<script>
    $('#tab1 input').attr('readonly','readonly');
    $('#tab2 input').attr('readonly','readonly');
    $('#tab2 select').attr('disabled','disabled');
    $(document).ready(function() {
        $('.tab-label').click(function() {
            // 移除所有标签的激活状态和内容的显示状态
            $('.tab-label, .tab').removeClass('active');
            // 添加激活状态到点击的标签和对应的内容
            $(this).addClass('active');
            $('#' + $(this).attr('for')).addClass('active');
        });
    });
    $(function(){
        //自动获取选中的查勘人
        $("#chakan_group").each(function(){
            var chakan_group=$("#chakan_group").val()
            if(!chakan_group) return false;
            var target = $(this).find("option:selected");
            var name = target.data('name');//获取选定的值
            $('#chakan_group_name').val(name);
            $.ajax({
                type: 'post',
                url: "{:url('buchang/diaodu/jigou')}",//发送路径
                data: {
                    chakan_group:chakan_group,
                },//发送的数据
                dataType: 'json',
                async: false,//是否异步
                success: function (res) {
                    var html='<option>请选择查勘人</option>';
                    var data = res.data
                    for(var i = 0;i<data.length;i++){
                        html += '<option value="'+ data[i].username +'" '+({$row['chakan_user_id']}==data[i].id?'selected':'')+' data-name="'+data[i].id+'">'+data[i].username+'</option>';
                    }
                    $("#chakan_user_list").html(html)
                }
            })
            get_diaodu_log({$row['chakan_user_id']})
        });

        // $("#chakan_ren_name").each(function(){
        //     document.getElementById('chakan_ren_name').addEventListener('input', function() {
        //         const browser = this.value;
        //         console.log('++++++',browser)
        //         const displayText = document.querySelector(`#chakan_user_list option[value="${browser}"]`).textContent;
        //         console.log('-------',displayText)
        //         console.log('-------11',document.querySelector(`#chakan_user_list option[value="${browser}"]`))
        //         $('#chakan_user_id').val(displayText); // 或者你可以使用其他方式来提示用户，比如显示在下方或旁边的小提示框中。
        //     });
        // });


    });
    //自动获取选中的查勘人
    $("#chakan_group").change(function(){
        var chakan_group=$("#chakan_group").val()
        if(!chakan_group) return false;
        $.ajax({
            type: 'post',
            url: "{:url('buchang/diaodu/jigou')}",//发送路径
            data: {
                chakan_group:chakan_group,
            },//发送的数据
            dataType: 'json',
            async: false,//是否异步
            success: function (res) {
                var html='<option>请选择查勘人</option>';
                var data = res.data
                for(var i = 0;i<data.length;i++){
                    html += '<option value="'+ data[i].username +'" data-name="'+data[i].id+'">'+data[i].username+'</option>';
                }
                $("#chakan_user_list").html(html)
            }
        })
    });
    //自动获取选中的查勘人
    $("#chakan_ren_name").change(function(){
        var chakan_user_id=$("#chakan_user_id").val()
        // var target = $(this).find("option:selected");
        // var name = target.data('name');//获取选定的值
        // $('#chakan_ren_name').val(name);
        $.ajax({
            type: 'post',
            url: "{:url('buchang/diaodu/jigou_ren')}",//发送路径
            data: {
                id:chakan_user_id,
            },//发送的数据
            dataType: 'json',
            async: false,//是否异步
            success: function (res) {
                console.log(res)
                $("#mobile").val(res.data)
            }
        })
        get_diaodu_log(chakan_user_id)
    });
    //获取历史委派任务
    function get_diaodu_log(id){
        if (id != undefined && id != "") {
            let bid = {$row['id']};
            console.log('bid',bid)
            $.ajax({
                type: 'post',
                url: "{:url('buchang/diaodu/diaodu_log')}",//发送路径
                data: {id:id,bid:bid},//发送的数据
                dataType: 'json',
                success: function (resp) {
                    if (resp.code == 1) {
                        let task = resp.data.task.split(",");
                        let task_num = resp.data.task_num.split(",");
                        if (task.length == task_num.length) {
                            for (let i = 1; i <= 5; i++) {
                                $("#gai_task_" + i).prop("checked", false);
                                $("#gai_task_num_" + i).val("1");
                            }
                            for (let i = 0; i < task.length; i++) {
                                if(task[i] == 1){
                                    $("#gai_task_num_" + task[i]).attr("readonly", 'readonly');
                                }
                                $("#gai_task_" + task[i]).prop("checked", true);
                                $("#gai_task_num_" + task[i]).val(task_num[i]);
                            }
                        }
                    }
                }
            });
        }
    }
</script>
<script type="text/javascript">
    document.getElementById('chakan_ren_name').addEventListener('input', function() {
        const browser = this.value;
        console.log('++++++',browser)
        const displayText = document.querySelector(`#chakan_user_list option[value="${browser}"]`).textContent;
        console.log('------',displayText)
        var displayText1 = document.querySelector(`#chakan_user_list option[value="${browser}"]`).getAttribute('data-name');
        console.log('/////',displayText1)

        $('#chakan_ren_name').val(displayText); // 或者你可以使用其他方式来提示用户，比如显示在下方或旁边的小提示框中。
        $('#chakan_user_id').val(displayText1); // 或者你可以使用其他方式来提示用户，比如显示在下方或旁边的小提示框中。
    });
</script>
